import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
/**
 * Create by laoge
 * on 2021/4/13 0013
 */

class Mine extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Scaffold(
        appBar: AppBar(
          title: Text(""),
          backgroundColor: Colors.white,
          elevation: 0,
          systemOverlayStyle: SystemUiOverlayStyle(
              statusBarColor: Colors.white,
              statusBarBrightness: Brightness.dark),
        ),
        body: Container(
          width: MediaQuery.of(context).size.width,
          height: MediaQuery.of(context).size.height,
          child: SingleChildScrollView(
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                Container(
                  color: Colors.white,
                  padding: EdgeInsets.only(bottom: 25),
                  child: Column(
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: [
                      GestureDetector(
                        onTap: () {},
                        child: Container(
                          padding: EdgeInsets.only(
                              top: 15, bottom: 10, left: 25, right: 20),
                          child: Row(
                            children: [
                              ClipRRect(
                                borderRadius: BorderRadius.all(Radius.circular(5)),
                                child: Image.asset(
                                  "assets/images/avater.jpg",
                                  width: 70,
                                ),
                              ),
                              SizedBox(
                                width: 20,
                              ),
                              Expanded(
                                  child: Column(
                                    crossAxisAlignment: CrossAxisAlignment.start,
                                    children: [
                                      Text(
                                        "阿布",
                                        style: TextStyle(
                                            fontSize: 20, fontWeight: FontWeight.bold),
                                      ),
                                      SizedBox(
                                        height: 15,
                                      ),
                                      Row(
                                        children: [
                                          Text(
                                            "微信号：ab20210413",
                                            style: TextStyle(
                                                fontSize: 16,
                                                color: Colors.grey.shade600),
                                          ),
                                          Spacer(),
                                          Row(
                                            children: [
                                              Image.asset(
                                                "assets/images/qrcode.png",
                                                width: 20,
                                              ),
                                              SizedBox(
                                                width: 10,
                                              ),
                                              Image.asset(
                                                "assets/images/next.png",
                                                width: 20,
                                                color: Colors.grey.shade400,
                                              )
                                            ],
                                          )
                                        ],
                                      )
                                    ],
                                  ))
                            ],
                          ),
                        ),
                      ),
                      Container(
                        width: 65,
                        height: 25,
                        margin: EdgeInsets.only(left: 115,top: 10),
                        alignment: Alignment.center,
                        decoration: BoxDecoration(
                            color: Colors.white,
                            borderRadius: BorderRadius.all(Radius.circular(20)),
                            border: Border.all(color: Colors.grey,width: .5)
                        ),
                        child: Row(
                          mainAxisAlignment: MainAxisAlignment.center,
                          children: [
                            Icon(Icons.add,color: Colors.grey,),
                            Text("状态",style: TextStyle(color: Colors.grey,fontSize: 13),)
                          ],
                        ),
                      ),
                    ],
                  ),
                ),
                SizedBox(height: 10,),
                buildItem((){},"assets/images/wxpay.png","支付"),
                SizedBox(height: 10,),
                buildItem((){},"assets/images/collect.png","收藏"),
                buildItem((){},"assets/images/picture.png","朋友圈"),
                buildItem((){},"assets/images/emoij.png","表情"),
                SizedBox(height: 10,),
                buildItem((){},"assets/images/setting.png","设置"),
              ],
            ),
          ),
        ));
  }
  Ink buildItem(Function press,String image,String text) {
    return Ink(
      child: InkWell(
        onTap: press,
        child: Container(
          color: Colors.white,
          child: Row(
            children: [
              SizedBox(
                width: 15,
              ),
              Image.asset(
                image,
                width: 20,
              ),
              SizedBox(
                width: 12,
              ),
              Expanded(
                  child: Container(
                    padding: EdgeInsets.only(top: 15, right: 15, bottom: 15),
                    child: Row(
                      children: [
                        Expanded(
                            child: Text(
                              text,
                              style: TextStyle(color: Colors.black, fontSize: 18),
                            )),
                        Image.asset(
                          "assets/images/next.png",
                          width: 20,
                          color: Colors.grey,
                        )
                      ],
                    ),
                  ))
            ],
          ),
        ),
      ),
    );
  }
}
